TASK-1¶

Matplotlib Example 👇🏻¶

In [22]:
import matplotlib.pyplot as plt
import numpy as np

# Fixing random state for reproducibility
np.random.seed(19680801)

fig, ax = plt.subplots()

# Example data
people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim')
y_pos = np.arange(len(people))
performance = 3 + 10 * np.random.rand(len(people))
error = np.random.rand(len(people))

ax.barh(y_pos, performance, xerr=error, align='center')
ax.set_yticks(y_pos, labels=people)
ax.invert_yaxis()  # labels read top-to-bottom
ax.set_xlabel('Performance')
ax.set_title('How fast do you want to go today?')

plt.show()

Seaborn Example¶

In [24]:
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt

sns.set_theme(style="ticks")

diamonds = sns.load_dataset("diamonds")

f, ax = plt.subplots(figsize=(7, 5))
sns.despine(f)

sns.histplot(
    diamonds,
    x="price", hue="cut",
    multiple="stack",
    palette="light:m_r",
    edgecolor=".3",
    linewidth=.5,
    log_scale=True,
)
ax.xaxis.set_major_formatter(mpl.ticker.ScalarFormatter())
ax.set_xticks([500, 1000, 2000, 5000, 10000])
Out[24]:
[<matplotlib.axis.XTick at 0x1b2675c9d90>,
 <matplotlib.axis.XTick at 0x1b269abca90>,
 <matplotlib.axis.XTick at 0x1b269dc1b10>,
 <matplotlib.axis.XTick at 0x1b269b02c90>,
 <matplotlib.axis.XTick at 0x1b269e0a5d0>]

Plotly Express¶

In [1]:
import plotly.express as px
import plotly.offline as offline
import plotly.graph_objs as go

offline.init_notebook_mode()
df = px.data.medals_long()


fig = px.bar(df, x="medal", y="count", color="nation",
             pattern_shape="nation", pattern_shape_sequence=[".", "x", "+"])
fig.show()

The link for this 🔗 GitHub REPO.

Name of dog It's origin
Labrador United Kingdom
German Shepherd Germany

🐶 [DOGGG!!!]isolated-happy-smiling-dog-white-background-portrait-4.jpg